/////////////////////////////////////////////////////////////////////////////
// Name:        ax_containerctrl.h
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     22/03/2009 10:08:34
// RCS-ID:      
// Copyright:   
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#ifndef _AX_CONTAINERCTRL_H_
#define _AX_CONTAINERCTRL_H_

/*
 * Includes
 */

////@begin includes
#include "wx/listctrl.h"
////@end includes

#include "wx/timer.h"

#include "ax/ax_pagerctrl.h"

/*
 * Forward declarations
 */

////@begin forward declarations
class AxMenuListCtrl;
class AxPagerCtrl;
////@end forward declarations

class AxMenuController;

/*!
 * Control identifiers
 */

////@begin control identifiers
#define SYMBOL_AXCONTAINERCTRL_STYLE wxTAB_TRAVERSAL
#define SYMBOL_AXCONTAINERCTRL_TITLE wxEmptyString
#define SYMBOL_AXCONTAINERCTRL_IDNAME ID_AXCONTAINERCTRL
#define SYMBOL_AXCONTAINERCTRL_SIZE wxSize(400, 300)
#define SYMBOL_AXCONTAINERCTRL_POSITION wxDefaultPosition
////@end control identifiers

// A timer class to wake up idle processing
class AxContainerCtrlWakeUpIdleTimer: public wxTimer
{
public:
    virtual void Notify();
};


/**
  @class AxContainerCtrl

  This class offers a predefined user interface for AxTk applications. Use with AxStandardMenuController,
  and add the control to a main frame or dialog.

  @category{ax}
 */

class AxContainerCtrl: public wxPanel
{    
    DECLARE_DYNAMIC_CLASS( AxContainerCtrl )
    DECLARE_EVENT_TABLE()

public:
    /// Constructors
    AxContainerCtrl();
    AxContainerCtrl( wxWindow* parent, wxWindowID id = SYMBOL_AXCONTAINERCTRL_IDNAME, const wxPoint& pos = SYMBOL_AXCONTAINERCTRL_POSITION, const wxSize& size = SYMBOL_AXCONTAINERCTRL_SIZE, long style = SYMBOL_AXCONTAINERCTRL_STYLE );

    /// Creation
    bool Create( wxWindow* parent, wxWindowID id = SYMBOL_AXCONTAINERCTRL_IDNAME, const wxPoint& pos = SYMBOL_AXCONTAINERCTRL_POSITION, const wxSize& size = SYMBOL_AXCONTAINERCTRL_SIZE, long style = SYMBOL_AXCONTAINERCTRL_STYLE );

    /// Destructor
    ~AxContainerCtrl();

    /// Initialises member variables
    void Init();

    /// Creates the controls and sizers
    void CreateControls();

    AxMenuListCtrl* GetMenuCtrl() const { return m_menuCtrl; }
    wxTextCtrl* GetTitleCtrl() const { return m_titleCtrl; }
    wxTextCtrl* GetDescriptionCtrl() const { return m_descriptionCtrl; }
    AxPagerCtrl* GetPagerCtrl() const { return m_pagerCtrl; }

    AxMenuController* GetController() const { return m_controller; }
    void SetController(AxMenuController* controller) { m_controller = controller; }

    void OnSysColourChanged(wxSysColourChangedEvent& event);

////@begin AxContainerCtrl event handler declarations

    /// wxEVT_IDLE event handler for ID_AXCONTAINERCTRL
    void OnIdle( wxIdleEvent& event );

    /// wxEVT_COMMAND_LIST_KEY_DOWN event handler for wxID_ANY
    void OnAnyKeyDown( wxListEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_UP
    void OnUpClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_UP
    void OnUpUpdate( wxUpdateUIEvent& event );

    /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_HOME
    void OnHomeClick( wxCommandEvent& event );

    /// wxEVT_UPDATE_UI event handler for ID_HOME
    void OnHomeUpdate( wxUpdateUIEvent& event );

////@end AxContainerCtrl event handler declarations

////@begin AxContainerCtrl member function declarations

    /// Retrieves bitmap resources
    wxBitmap GetBitmapResource( const wxString& name );

    /// Retrieves icon resources
    wxIcon GetIconResource( const wxString& name );
////@end AxContainerCtrl member function declarations

    /// Should we show tooltips?
    static bool ShowToolTips();

////@begin AxContainerCtrl member variables
    wxTextCtrl* m_titleCtrl;
    AxMenuListCtrl* m_menuCtrl;
    AxPagerCtrl* m_pagerCtrl;
    wxTextCtrl* m_descriptionCtrl;
    /// Control identifiers
    enum {
        ID_AXCONTAINERCTRL = 10000,
        ID_UP = 10004,
        ID_HOME = 10005
    };
////@end AxContainerCtrl member variables

    AxMenuController*               m_controller;
    AxContainerCtrlWakeUpIdleTimer  m_wakeUpIdleTimer;
};

#endif
    // _AX_CONTAINERCTRL_H_
